<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { useUserStore } from '@/store/user'
import { useDeviceStore } from '@/store/device'
import { usePaymentStore } from '@/store/payment'

// 初始化stores
const userStore = useUserStore()
const deviceStore = useDeviceStore()
const paymentStore = usePaymentStore()

onLaunch(() => {
  console.log("App Launch");
  
  // 初始化用户信息
  userStore.initUserInfo()
  
  // 初始化设备数据
  deviceStore.initDevices()
});

onShow(() => {
  console.log("App Show");
});

onHide(() => {
  console.log("App Hide");
});
</script>

<style lang="scss">
@import "uview-pro/index.scss";
</style>